package com.session01;

public class EnumTest01 {
    public static void main(String[] args) {
        Month month = Month.JANUARY;
        System.out.println(month.getMonth() + month.getSeason());
        System.out.println(month.ordinal());
        System.out.println(month.valueOf("JANUARY"));
        System.out.println(month.compareTo(Month.FEBRUARY));
        System.out.println(month.equals(Month.APRIL));

        for (Month month1 : Month.values()) {
            System.out.print(month1.name() + " ");
        }
    }
}

enum Month {
    JANUARY("1月份", "冬季"),
    FEBRUARY("2月份", "冬季"),
    MARCH("3月份", "春季"),
    APRIL("4月份", "春季"),
    MAY("5月份", "春季"),
    JUNE("6月份", "夏季"),
    JULY("7月份", "夏季"),
    AUGUST("8月份", "夏季"),
    SEPTEMBER("9月份", "秋季"),
    OCTOBER("10月份", "秋季"),
    NOVEMBER("11月份", "秋季"),
    DECEMBER("12月份", "冬季");

    private String month;
    private String season;

    public String getMonth() {
        return month;
    }

    public String getSeason() {
        return season;
    }

    private Month(String month, String season) {
        this.month = month;
        this.season = season;
    }
}